package com.example.gate.test;

public class WebSocketClientExample {
    public static void main(String[] args) throws Exception {
        String url = "ws://localhost:26000/ws";
        WebSocketClient client = new WebSocketClient(url);
        
        try {
            // 连接服务器
            client.connect();
            System.out.println("Connected to WebSocket server");
            
            // 发送消息
            client.send();
            
            // 保持连接，等待服务器消息
            Thread.sleep(5000);
        } finally {
            // 关闭连接
            client.close();
        }
    }
}